package com.meringer.entities;

import java.io.Serializable;
import java.lang.Integer;
import java.lang.String;
import java.util.List;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: CarModel
 *
 */
@NamedQueries({
@NamedQuery(name="CarModel.getCarModels",
    query="SELECT m FROM CarModel m")          
})
@Entity
@Table(name="T_CAR_MODELS")

public class CarModel implements Serializable
{
	private static final long serialVersionUID = 1L;
	   
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="MODEL_ID", nullable=false)
	private Integer modelID;
	
	@Column(name="NAME", nullable=false, length = 30)
	private String name;
	
	@Column(name="PRICE", nullable=false)
	private Integer price;
	
	@Column(name="INIT_TOP_SPEED", nullable=false)
	private Integer initTopSpeed;
	
	@Column(name="INIT_ACCELERATION", nullable=false)
	private Integer initAcceleration;
	
	@Column(name="INIT_HANDLING", nullable=false)
	private Integer initHandling;
	
	@Column(name="MAX_TOP_SPEED", nullable=false)
	private Integer maxTopSpeed;
	
	@Column(name="MAX_ACCELERATION", nullable=false)
	private Integer maxAcceleration;
	
	@Column(name="MAX_HANDLING", nullable=false)
	private Integer maxHandling;

	@Column(name="IMG_PATH")
	private String imgPath;
	
	@OneToMany(mappedBy="model")
	private List<Car> cars;

	public CarModel() {
		super();
	}   
	
	public CarModel(String name, Integer price, Integer initTopSpeed,
			Integer initAcceleration, Integer initHandling, Integer maxTopSpeed,
			Integer maxAcceleration, Integer maxHandling, String imgPath,
			List<Car> cars) {
		super();
		this.name = name;
		this.price = price;
		this.initTopSpeed = initTopSpeed;
		this.initAcceleration = initAcceleration;
		this.initHandling = initHandling;
		this.maxTopSpeed = maxTopSpeed;
		this.maxAcceleration = maxAcceleration;
		this.maxHandling = maxHandling;
		this.imgPath = imgPath;
		this.cars = cars;
	}

	public Integer getModelID() {
		return this.modelID;
	}

	public void setModelID(Integer modelID) {
		this.modelID = modelID;
	}   
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}   
	public Integer getPrice() {
		return this.price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}   
	public String getImgPath() {
		return this.imgPath;
	}

	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}
	public List<Car> getCars() {
		return cars;
	}
	public void setCars(List<Car> cars) {
		this.cars = cars;
	}

	public Integer getInitTopSpeed() {
		return initTopSpeed;
	}

	public void setInitTopSpeed(Integer initTopSpeed) {
		this.initTopSpeed = initTopSpeed;
	}

	public Integer getInitAcceleration() {
		return initAcceleration;
	}

	public void setInitAcceleration(Integer initAcceleration) {
		this.initAcceleration = initAcceleration;
	}

	public Integer getInitHandling() {
		return initHandling;
	}

	public void setInitHandling(Integer initHandling) {
		this.initHandling = initHandling;
	}

	public Integer getMaxTopSpeed() {
		return maxTopSpeed;
	}

	public void setMaxTopSpeed(Integer maxTopSpeed) {
		this.maxTopSpeed = maxTopSpeed;
	}

	public Integer getMaxAcceleration() {
		return maxAcceleration;
	}

	public void setMaxAcceleration(Integer maxAcceleration) {
		this.maxAcceleration = maxAcceleration;
	}

	public Integer getMaxHandling() {
		return maxHandling;
	}

	public void setMaxHandling(Integer maxHandling) {
		this.maxHandling = maxHandling;
	}
   
}
